/*function validateDateValid(start_date,end_date){
     var s_d =Date.parse($(start_date).val());
     var e_d =Date.parse($(end_date).val());
     if(new Date(e_d -s_d )<0){
         //alert(SUGAR.language.get('app_strings','LBL_CHECK_VALID_DATE')) ;
         //$(end_date).focus();
         return false;
     }
     return true;
} */

/*function validateDateValid(start_date,end_date){
     var s_d =Date($(start_date).val());
     var e_d =Date($(end_date).val());
     s_d_time = s_d.getTime();
     e_d_time = e_d.getTime();
     if(s_d_time > e_d_time){
         //alert(SUGAR.language.get('app_strings','LBL_CHECK_VALID_DATE')) ;
         //$(end_date).focus();
         return false;
     }
     return true;
}*/

function validateDateValid(start_date,end_date){
     var s_d = $(start_date).val();
     var e_d = $(end_date).val();
     //start_date =  new Date(s_d).valueOf();
     //end_date = new Date(e_d).valueOf();
     //var start_date = Date.UTC(s_D.getFullYear(), s_D.getMonth()+1, s_D.getDate());
    // var end_date = Date.UTC(e_D.getFullYear(), e_D.getMonth()+1, e_D.getDate());
     
     if(process(s_d) > process(e_d)){
         return false;
     }
     return true;
}

function process(date){
   var parts = date.split("/");
   return new Date(parts[2], parts[1] - 1, parts[0]);
}